package com.mine;

public class FindDiffChar {
    public static Character find(char[] arrayA, char[] arrayB) {
        if (arrayB.length == 0) {
            return null;
        }
        for (int i = 0; i < arrayA.length - 1; i++) {
            if (arrayA[i] != arrayB[i]) {
                return arrayA[i];
            }
        }
        return null;
    }

    public static void main(String[] args) {
        char[] a = new char[]{'a', 'b', 'c', 'd'};
        char[] b = new char[]{'a', 'b', 'd'};
        System.out.println(find(a, b));
    }
}
